import time
def sortir(name):
    file = open(name)
    suppy = [int(el.strip()) for el in file.readlines()]
    file.close()
    t_start = time.time()
    for i in range(len(suppy) - 1):
        for j in range(len(suppy) - i - 1):
            if suppy[j] > suppy[j + 1]:
                suppy[j], suppy[j + 1] = suppy[j + 1], suppy[j]
    t_finish = time.time()
    print(name[:-4], round((t_finish - t_start) * 1000), 'milliseconds')
sortir('m1_sorted.txt')
sortir('m2_reverse.txt')
sortir('m3_shuffle.txt')